package com.xiaoxiong.mami.service;

import com.xiaoxiong.mami.dao.daomain.UserAddress;
import com.xiaoxiong.mami.dao.mapper.UserAddressMapperImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserAddressService implements UserAddressMapperImpl {

    @Autowired
    private UserAddressMapperImpl userAddressMapperImpl;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return 0;
    }

    @Override
    public int insert(UserAddress record) {
        return 0;
    }

    @Override
    public int insertAddress(UserAddress record) {
        return userAddressMapperImpl.insertAddress(record);
    }

    @Override
    public int updateByUserId(UserAddress record) {
        return userAddressMapperImpl.updateByUserId(record);
    }

    @Override
    public Integer updateAddressDef(@Param("userId") String userId, @Param("id") String id, @Param("isDef") boolean isDef) {
        return userAddressMapperImpl.updateAddressDef(userId,id,isDef);
    }

    @Override
    public int insertSelective(UserAddress record) {
        return userAddressMapperImpl.insertSelective(record);
    }

    @Override
    public UserAddress selectByPrimaryKey(Long id) {
        return userAddressMapperImpl.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(UserAddress record) {
        return userAddressMapperImpl.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(UserAddress record) {
        return 0;
    }

    @Override
    public int updateDefIsNot(String userId) {
        return userAddressMapperImpl.updateDefIsNot(userId);
    }

    @Override
    public List<UserAddress> getAddressByUserId(String userId) {
        return userAddressMapperImpl.getAddressByUserId(userId);
    }

    @Override
    public UserAddress getAddressByAddressId(String userId, String id) {
        return userAddressMapperImpl.getAddressByAddressId(userId,id);
    }

    @Override
    public Integer deleteAddressByAddressId(Integer id) {
        return userAddressMapperImpl.deleteAddressByAddressId(id);
    }
}
